<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Db Php Helper</title>
<script type="text/javascript">
<!--


function searchMethod(){
	document.form1.act.value="search";
	//alert(document.form1.action.value);

	return true;
}
function loadMethod(){
	document.form1.act.value="load";
	return true;
}
function isExistMethod(){
	document.form1.act.value="isExist";
	return true;
}

function phpClassMethod(){
	document.form1.act.value="PhpClass";
	return true;
}
function helpCode(){
	document.form1.act.value="helpCode";
	return true;
}

function insertMethod(){
	document.form1.act.value="insertMethod";
	return true;
}

function updateMethod(){
	document.form1.act.value="updateMethod";
	return true;
}
function deleteMethod(){
	document.form1.act.value="deleteMethod";
	return true;
}



//-->
</script>
<style type="text/css">
<!--
.sp {
	font-weight: bold;
	color: #F00;
}
-->
</style>
</head>

<body>
<div align="center">
<form action="Creater.php" method="post" name="form1" target="_blank" id="form1">
<textarea name="info" cols="100" rows="5" readonly="readonly"><{$info}></textarea>



<input name="tableSize" type="hidden" value="<{$tableSize}>" />
<p><{foreach from=$tables name=ta item=tab}></p>
<hr />

<table width="100%" border="1">
  <tr>
    <td width="50%">Table Name:<span class="sp"><{$tab->tableName}></span></td>
    <td width="50%">Alias Name:<span class="sp"><{$tab->aliasName}></span></td>
    </tr>
</table>

  <input name="tableName<{$smarty.foreach.ta.index}>" type="hidden" value="<{$tab->tableName}>" />
  <input name="aliasName<{$smarty.foreach.ta.index}>" type="hidden" value="<{$tab->aliasName}>" />
  <input name="columnSize<{$smarty.foreach.ta.index}>" type="hidden" value="<{$tab->columnSize}>" />
 
  
</p>
<table  border="1">
  <tr>
    <td width="100">Field</td>
    <td width="100">Type</td>
    <td width="100">attribute name</td>
    <td width="100"> Load/<br />Insert/<br />Update</td>
    <td width="100">EscapeString</td>
    <td width="100">Fixed Value</td>
    <td width="100">EqualCondition</td>
    <td width="100">Mininum Condition</td>
    <td width="100">Maximum Condition</td>
    <td width="100">LikeHead</td>
    <td width="100">LikeTail</td>
    
    </tr>
  
  <{foreach from=$tab->data item=oneFild name=foo}>
  <input name="extra<{$smarty.foreach.ta.index}>_<{$smarty.foreach.foo.index}>" type="hidden" value="<{$oneFild->Extra}>" />
  <input name="newType<{$smarty.foreach.ta.index}>_<{$smarty.foreach.foo.index}>" type="hidden" value="<{$oneFild->newType}>" />
  <input name="newTypeSize<{$smarty.foreach.ta.index}>_<{$smarty.foreach.foo.index}>" type="hidden" value="<{$oneFild->newTypeSize}>" />
   <input name="field<{$smarty.foreach.ta.index}>_<{$smarty.foreach.foo.index}>" type="hidden" value="<{$oneFild->Field}>" />
  <tr bgcolor="<{if ($smarty.foreach.foo.index %2==0)}>#99FF00 <{else}>#CC99FF<{/if}>">
    <td>&nbsp;<{$oneFild->Field}><{if $oneFild->Extra=="auto_increment"}> (A_I)<{/if}></td>
    <td>&nbsp;<{$oneFild->newType}>:<{$oneFild->newTypeSize}></td>
    <td>&nbsp;
      <input name="attribute<{$smarty.foreach.ta.index}>_<{$smarty.foreach.foo.index}>" type="text" value="<{$oneFild->attribute}>"/></td>
    <td><label>
      <input type="checkbox" name="need<{$smarty.foreach.ta.index}>_<{$smarty.foreach.foo.index}>" value='<{$oneFild->attribute}>' id='need<{$smarty.foreach.foo.index}>' checked="checked"  />
    </label></td>   
    <td><label>
      <input type="checkbox" name="escapeStr<{$smarty.foreach.ta.index}>_<{$smarty.foreach.foo.index}>" value='<{$oneFild->attribute}>' id='escapeStr<{$smarty.foreach.foo.index}>' <{if $oneFild->enableEscape}>checked="checked" <{/if}> />
      </label></td>  
      <td>
      <input name="fixedValue<{$smarty.foreach.ta.index}>_<{$smarty.foreach.foo.index}>" type="text" size="10" />
      </td> 
    <td><label>
      <input type="checkbox" name="equalCondition<{$smarty.foreach.ta.index}>_<{$smarty.foreach.foo.index}>" value='<{$oneFild->attribute}>' id='equalCondition<{$smarty.foreach.ta.index}>_<{$smarty.foreach.foo.index}>'  />
      </label></td>    
    <td><label>
      <strong>&gt;</strong>
<input type="checkbox" name="minCondition<{$smarty.foreach.ta.index}>_<{$smarty.foreach.foo.index}>" value='<{$oneFild->attribute}>' id='minCondition<{$smarty.foreach.ta.index}>_<{$smarty.foreach.foo.index}>'  /><br />
      <strong>=</strong>
<input type="checkbox" name="minAndEqualCondition<{$smarty.foreach.ta.index}>_<{$smarty.foreach.foo.index}>" value='<{$oneFild->attribute}>' id='minAndEqualCondition<{$smarty.foreach.ta.index}>_<{$smarty.foreach.foo.index}>'  />
      </label></td>
    <td><label>
      &gt;
      <input type="checkbox" name="maxCondition<{$smarty.foreach.ta.index}>_<{$smarty.foreach.foo.index}>" value='<{$oneFild->attribute}>' id='maxCondition<{$smarty.foreach.ta.index}>_<{$smarty.foreach.foo.index}>'  /><br />
      =
      <input type="checkbox" name="maxAndEqualCondition<{$smarty.foreach.ta.index}>_<{$smarty.foreach.foo.index}>" value='<{$oneFild->attribute}>' id='maxAndEqualCondition<{$smarty.foreach.ta.index}>_<{$smarty.foreach.foo.index}>'  />
      </label></td>
    <td><label>
      <input type="checkbox" name="likeHeadCondition<{$smarty.foreach.ta.index}>_<{$smarty.foreach.foo.index}>" value='<{$oneFild->attribute}>' id='likeHeadCondition<{$smarty.foreach.ta.index}>_<{$smarty.foreach.foo.index}>'  />
      </label></td>
    <td><label>
      <input type="checkbox" name="likeTailCondition<{$smarty.foreach.ta.index}>_<{$smarty.foreach.foo.index}>" value='<{$oneFild->attribute}>' id='likeTailCondition<{$smarty.foreach.ta.index}>_<{$smarty.foreach.foo.index}>' />
      </label></td>
    </tr>
  <{/foreach}>
</table>
<br />
Defined Table Name:<input name="definedTableName<{$smarty.foreach.ta.index}>" type="text" value="<{$tab->definedTableName}>" size="40" />
<{/foreach}>



<p>
  <label>
    Class Name:<input name="className"  size="34" type="text" id="className" value="<{$className}>" />
  </label>
  
</p>
<p>
  <label>DB Class Path:
    <input name="dbClassPath" type="text" id="DB Class Path:" value="<{$dbClassPath|escape}>" size="90" />
  </label>
</p>
<p>Sql part:
  <label>
    <input name="joinSql" type="text" id="joinSql" value="<{$joinSql|escape}>" size="170" />
  </label>
</p>
<table width="842" border="1">
  <tr bgcolor="#CC99FF">
    <td ><input name="input4" type="submit" onclick="phpClassMethod()" value="CreatePhpClass" />
    <input type="checkbox" name="class_file_download_mode" value="1"/>Download file
    </td>
  </tr>
    <tr bgcolor="#99FF00">
    <td ><p>Delete Function Name:
        <label>
        <input name="deleteFunctionName" type="text" id="deleteFunctionName" value="Delete" />
      </label>
    </p>
      <p>
        <input name="input4" type="submit" onclick="deleteMethod()" value="CreateDelete" />
      </p></td>
  </tr>

  <tr bgcolor="#CC99FF">
    <td ><p>Insert Function Name:
      <label>
        <input name="creatFunctionName" type="text" id="creatFunctionName" value="Create" />
      </label>
    </p>
      <p>
        <label>
          <input type="checkbox" name="insertAutoIncreasingID" id="insertAutoIncreasingID" value="1"/>
          Insert Auto IncreasingID</label>
      </p>
      <p>
        <input name="input4" type="submit" onclick="insertMethod()" value="CreateInsert" />
      </p></td>
  </tr>
  <tr bgcolor="#99FF00">
    <td ><p>Update Function Name:
      <label>
        <input name="updateFunctionName" type="text" id="updateFunctionName" value="Update" />
      </label>
    </p>
      <label>
          <input type="checkbox" name="updateAutoIncreasingID" id="insertAutoIncreasingID" value="1"/>
          Update Auto IncreasingID</label>
      <p>
        <input name="input4" type="submit" onclick="updateMethod()" value="CreateUpdate" />
      </p></td>
  </tr>
  <tr bgcolor="#CC99FF">
    <td bgcolor="#CC99FF">
      <p>Load Function Name:
  <input name="lfunctionName" type="text" value="Load" size="50" maxlength="100" />
  </p>
      <p><br />
        <input name="input2" type="submit" onclick="loadMethod()" value="CreateLoadMethod" />
      </p></td>
  </tr>
  <tr bgcolor="#CC99FF">
    <td bgcolor="#99FF00">
      <p>IsExist Function Name:
        <input name="iefunctionName" type="text" value="IsExist" size="50" maxlength="100" id="iefunctionName" />
  </p>
      <p><br />
        <input name="input2" type="submit" onclick="isExistMethod()" value="CreateIsExistMethod" />
      </p></td>
  </tr>
  <tr bgcolor="#99FF00">
    <td bgcolor="#CC99FF">
    
   
      <p>Search Function Name:
  <input name="sfunctionName" type="text" value="Search" size="50" maxlength="100" />
  <br />
        Sort option:
        
        <input name="sortOption" type="text" id="sortOption" value="0" size="5" maxlength="3" />
        <label>
          <input type="checkbox" name="createPageFunction" id="createPageFunction"  value="1"/>
          Create Paged Search Function</label>
      </p>
      <p><br />
        <input name="input" type="submit" onclick="searchMethod()" value="CreateSearchMethod" />
      </p></td>
  </tr>
  <tr bgcolor="#CC99FF">
    <td bgcolor="#99FF00"><p>
      <label>
        SmartName:<input name="smartName" type="text" id="smartName" value="template" />
        <br />
        Imput textarea flag:<input name="inputTextLimit" type="text" id="smartName" value="40" />
        <br />
        <br />
      </label>
        <input name="input3" type="submit" onclick="helpCode()" value="CreateHelpCode" />
      </p></td>
  </tr>
</table>
<p>&nbsp;</p>
<p>
  <input name="act" type="hidden" value="a" />
</p>
<p>&nbsp;</p>
</form>
<p>&nbsp;</p>
</div>
<br />
<br /></body>

</html>
